ORG 100H

MOV CX, 5
CALL OUTCX
IMUL CX, CX
CALL OUTCX
MOV AX, CX
MOV T, WORD 5
CWD
IDIV T
MOV CX, AX
CALL OUTCX

MOV AH, 1
MOV AL, 0
MOV CX, AX
CALL OUTCX
CBW
MOV CX, AX
CALL OUTCX


INT 20H

T DW 2

OUTCX PROC
CMP CX, 0
JE ISZERO
LEA DX, NOTZERO
MOV AH, 09H
INT 21H
LEA DX, NEWLINE
MOV AH, 09H
INT 21H
PUSH CX
C:
	CALL OUTPUT
LOOP C
LEA DX, NEWLINE
MOV AH, 09H
INT 21H
POP CX
RET
ISZERO:
LEA DX, ZERO
MOV AH, 09H
INT 21H
LEA DX, NEWLINE
MOV AH, 09H
INT 21H
RET
ZERO DB 'ZERO$'
NOTZERO DB 'NOT ZERO$'
OUTCX ENDP

OUTPUT PROC
LEA DX, STR
MOV AH, 09H
INT 21H
RET
STR DB 'I$'
OUTPUT ENDP

NEWLINE DB 13
DB 10
DB '$'

